# Maintainer: Anatol Pomozov

pkgname=aws-crt-cpp
pkgver=0.20.0
pkgrel=1
pkgdesc='C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.'
arch=(loong64 x86_64)
url='https://github.com/awslabs/aws-crt-cpp'
license=(Apache)
depends=(gcc-libs aws-c-common aws-c-http aws-c-mqtt aws-c-auth aws-c-s3 aws-c-event-stream)
makedepends=(cmake)
source=(aws-crt-cpp-$pkgver.zip::https://github.com/awslabs/aws-crt-cpp/archive/v$pkgver.zip)
sha256sums=('4aaab8baa447247248d79f6b4ad866e09a8941e3304da894f8b266e94c6d6dcb')

build() {
  cd aws-crt-cpp-$pkgver

  cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DBUILD_DEPS=OFF -S . -B build
  cmake --build build
}

check() {
  cd aws-crt-cpp-$pkgver
  cmake --build build --target test
}

package() {
  cd aws-crt-cpp-$pkgver

  cmake --build build --target install -- DESTDIR="$pkgdir/"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
